æòÅⁿâoâiü[

File openDialog() Class Method


    File.openDialog(prompt, select)

Description

    The File.openDialog class method presents the File > Open dialog that is standard for the platform on which After Effects is running. This method overlaps somewhat with the easier to use fileGetDialog() global function.

Parameters

    prompt

    An optional prompt (expressed as a string) that is displayed as part of the dialog if the dialog permits the display of an additional message.

    select

    This argument allows the pre-selection of the files that the dialog displays. Unfortunately, this argument is different on the Macintosh and on Windows.

    select (Win)

    Windows selection string is actually a list of file types with explanative text. This list is displayed in the bottom of the dialog as a drop-down list box so the user can select which types of files to display. The elements of this list are separated by commas. Each element starts with the descriptive text, followed by a colon and the file search masks for this text. Again, each search mask is separated by a semicolon. A Selection list that allowed the selection of all text files (*.TXT and *.DOC) or all files would look like this:

    Text Files:*.TXT;*.DOC,All files:*

    A single asterisk character is a placeholder for all files.

    select (Mac)

    On the Macintosh, the optional second argument is a callback function. This function takes one argument, which is a File object. When the dialog is set up, it calls this callback function for each file that is about to be displayed. If the function returns anything else than true, the file is not displayed. This is only true for the openDialog() method, the saveDialog() method ignores this callback method.

Returns

    File object, or null if user cancels the dialog.

See also

    fileGetDialog() Global Function